//package org.game.module.dungeonbo;
//
//import com.sojoys.artifact.exception.AbstractLogicModelException;
//import com.sojoys.artifact.factory.session.ISession;
//import com.sojoys.artifact.tools.ToolError;
//import org.cfg.DungeonLevelCfg;
//import org.cfg.cache.DungeonLevelCfgCache;
//import org.error.GameErrorCode;
//import org.game.constant.DungeonTypeConstant;
//import org.game.constant.SessionConstent;
//import org.game.db.bean.DungeonLevel;
//import org.game.db.bean.Player;
//import org.game.db.cache.DungeonLevelCache;
//import org.game.manager.DungeonManager;
//import org.game.msgBuilder.DungeonMsgBuilder;
//import org.game.protobuf.c2s.C2SDungeonMsg;
//import org.game.protobuf.s2c.S2CDungeonMsg;
//import org.game.util.ProtoUnit;
//
//import java.util.List;
//
//@SuppressWarnings({"unchecked"})
//public class Old_DungeonBOImpl implements DungeonBO {
//
//    @Override
//    public byte[] fightStart(ISession session, C2SDungeonMsg.FightStartMsg msg) throws AbstractLogicModelException {
//        int cid = msg.getLevelCid();
//        DungeonLevelCfg dungeonLevelCfg = DungeonLevelCfgCache.me().getById(cid);
//        ToolError.isAndTrue(GameErrorCode.CLIENT_PARAM_IS_ERR, dungeonLevelCfg == null);
//        Player player = session.getAttr(SessionConstent.PLAYER);
//        int helpPlayerId = msg.getHelpPlayerId();
//
//        //获取关卡记录
//        DungeonLevel dungeonLevel = DungeonLevelCache.me().getDungeonLevelCacheProxy().getByPlayerIdCid(player.getId(), cid);
//        return DungeonManager.fightStart(player, dungeonLevelCfg, dungeonLevel,helpPlayerId);
//    }
//
//    @Override
//    public byte[] fightOver(ISession session, C2SDungeonMsg.FightOverMsg msg) throws AbstractLogicModelException {
//
//        int cid = msg.getLevelCid();
//        boolean isWin = msg.getIsWin();
//        int maxBatter = msg.getBatter();	//最大连击数
//        int pickUpTypeCount = msg.getPickUpTypeCount();//拾取道具种类个数
//    	int pickUpCount = msg.getPickUpCount();//拾取道具个数
//        List<Integer> goalsList = msg.getGoalsList();
//        Player player = session.getAttr(SessionConstent.PLAYER);
//        DungeonLevelCfg dungeonLevelCfg = DungeonLevelCfgCache.me().getById(cid);
//
//        //校验提交的关卡cid是否是服务器记录的关卡cid，并清除记录的关卡cid
//        int currentDungeonCid = player.getPlayerProxy().getCurrentDungeonCid();
//        player.getPlayerProxy().setCurrentDungeonCid(0);
//        ToolError.isAndTrue(GameErrorCode.CLIENT_PARAM_IS_ERR, cid != currentDungeonCid);
//        List<Integer> goals = msg.getGoalsList();
//
//        return DungeonManager.fightOver(player, dungeonLevelCfg, goalsList, isWin,goals,msg);
//    }
//
//    @Override
//    public byte[] promoteStory(ISession session, C2SDungeonMsg.ProgressMsg msg) throws AbstractLogicModelException {
//
//        int cid = msg.getMainLineCid();
//        Player player = session.getAttr(SessionConstent.PLAYER);
//
//        return DungeonManager.promoteStory(player, DungeonTypeConstant.DUNGEON_TYPE_MAIN_LINE, cid);
//    }
//
//    @Override
//    public byte[] getDungeonInfo(ISession session, C2SDungeonMsg.GetLevelInfo msg) throws AbstractLogicModelException {
//
//        Player player = session.getAttr(SessionConstent.PLAYER);
//        S2CDungeonMsg.GetLevelInfo dungeonRecordMsg = DungeonMsgBuilder.getDungeonRecordMsg(player);
//
//        return ProtoUnit.toByte(dungeonRecordMsg);
//    }
//
//    @Override
//    public byte[] buyFightCount(ISession session, S2CDungeonMsg.BuyFightCount msg) throws AbstractLogicModelException {
//        Player player = session.getAttr(SessionConstent.PLAYER);
//        int cid = msg.getCid();
//        return DungeonManager.buyFightCount(player, cid);
//    }
//
//    @Override
//    public byte[] getLevelGroupReward(ISession session, C2SDungeonMsg.GetLevelGroupReward msg) throws AbstractLogicModelException {
//        Player player = session.getAttr(SessionConstent.PLAYER);
//        int levelGroupCid = msg.getCid();
//        int difficulty = msg.getDifficulty();
//        int starNum = msg.getStarNum();
//        return DungeonManager.getLevelGroupReward(player, levelGroupCid,difficulty, starNum);
//    }
//}
